jmp SYMBOL_NAME(start_kernel)
+# Stack is 8kB. We leave 100 bytes trailer for fake 'pt_regs'.
+# This is needed so that iopl checks of the saved eflags register
+# work correctly, for example.
ENTRY(stack_start)
- .long SYMBOL_NAME(init_task_union)+8192, __KERNEL_DS
+ .long SYMBOL_NAME(init_task_union)+8192-100, __KERNEL_DS
.org 0x1000
ENTRY(empty_zero_page)
void __init setup_arch(char **cmdline_p)
{
+ struct pt_regs *regs = ((struct pt_regs *)current->thread.esp0) - 1;
unsigned long start_pfn, max_pfn, max_low_pfn;
unsigned long bootmap_size;
unsigned long i;
paging_init();
- if ( start_info.flags & SIF_PRIVILEGED )
+ /* Set privilege level gubbins. */
+ regs->eflags &= ~(3<<12);
+ if ( start_info.flags & SIF_PRIVILEGED ) {
/* We are privileged guest os - should have IO privileges. */
if( HYPERVISOR_set_priv_levels(1, 1) )
panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED");
+ regs->eflags |= 1<<12;
+ }
+ current->thread.hypercall_pl = 1;
if(start_info.flags & SIF_CONSOLE)
{